﻿#include<iostream>

using std::cout;
using std::endl;

namespace lxy
{
	int a = 0;
}

int a = 10;

void Swap(int& pa, int& pb)
{
	int temp = pa;
	pa = pb;
	pb = temp;
}
void Swap(double& pa, double& pb)
{
	double temp = pa;
	pa = pb;
	pb = temp;
}

int Add(int x = 0, int y = 1)
{
	return x + y;
}

int main()
{
	std::cout << "hello C++" << std::endl;
	int a = 100;
	//std::cin >> a;
	std::cout << lxy::a << endl;
	std::cout << ::a << endl;
	std::cout << a << endl;

	int b = 10;
	int& c = b;
	int& d = c;
	cout << b << endl << c << endl << d << endl;
	c = 20;
	cout << b << endl;

	Swap(a, b);
	cout << a << endl << b << endl;

	double e = 1.111;
	double f = 2.111;
	Swap(e, f);
	cout << "e=" << e << ",f=" << f << endl;

	cout << Add() << "," << Add(3) << endl;

	return 0;
}